﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            //  CommonLib.Model.
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //oracleConnection1.Open();
            //OracleConnection ora_conn = new OracleConnection("Data Source=pp;Persist Security Info=True;User ID=sxlongyuan;Password=longyuan;Unicode=True");
            //ora_conn.Open();

            //CommonLib.BLL.BaseCommonBll.GetUserDataStr("ddd");
            //string[,] bb = new string[,] { { "[会议编号]", "2015" } };
            //string aa = "[会议编号]";
            //string cc = "2015";
            //CommonLib.OfficeReport.MSOfficeReport wd = new CommonLib.OfficeReport.MSOfficeReport(2018);
            //wd.GenerateReportByTempleteForCs(aa, cc);
            // CommonLib.BLL.Ur_reportTemplate.
            // string aa=CommonLib.OfficeReport.ExcelReport.GenerateReportByTemplete(@"d:\会议记录.doc",2018,bb);
            // MessageBox.Show(aa);
            //   CommonLib.BLL.Ur_reportTemplate.
            DataTable t = CommonLib.BLL.BS_DATASET_CLASS.GetAllList().Tables[0];
            t = CommonLib.BLL.BS_DATASET_CLASS.GetAllList().Tables[0];
            t = CommonLib.BLL.BS_DATASET_CLASS.GetAllList().Tables[0];

            //CommonLib.Model.UR_REPORTTEMPLATE a = new CommonLib.Model.UR_REPORTTEMPLATE();
            //a.FFF = 5.25M;
            //a.REPORTTYPE_ID = 13;
            //a.TEMPLATE_ID = 14;
            //CommonLib.BLL.UR_REPORTTEMPLATE.Add(a);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //string a = CommonLib.ComMon.StringCommon.StringDecrypt("我的系统", "95559");

            /*
            int ParamCount = 4;
            OracleParameter[] _param = new OracleParameter[ParamCount];
            // _param[0] = new OracleParameter("RETURN", "0");
            _param[0] = new OracleParameter();
            _param[0].OracleDbType = OracleDbType.Int32;
            _param[0].Direction = ParameterDirection.ReturnValue;
            _param[1] = new OracleParameter("T_NAME", "lll");
            _param[2] = new OracleParameter("T_TABLE", "jjj");
            _param[3] = new OracleParameter("T_FIELD", "kii");

            OracleHelper.ExecuteScalar(Conn.SqlConnStr, CommandType.StoredProcedure, "GETNEWIDFORTABLE", _param);
            Decimal ReurnStr = (Decimal)_param[0].Value;
            //return ReurnStr;

            */


            //MessageBox.Show(a);
            // decimal ff = 0;
            // int a = CommonLib.BLL.StoreProcedure.GETNEWIDFORTABLE("111", ref ff);
            // decimal aa = ff;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            //解



            string aa = "196227";
            // char c='196';
            // char d='227';
            char[] a = aa.ToCharArray();
            byte[] array = { 196, 227 };
            //   byte[] array = Encoding.GetEncoding("ASCII").GetBytes(a);



            textBox1.Text = System.Text.Encoding.Default.GetString(array);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            string a = "declare sqlstr varchar2(8000);"
                + " type myrctype is ref cursor; "
                + " ResultCursor myrctype; "
                    + " begin "
                    + " sqlstr:='select * from yx_power_price';"
                    + " open   ResultCursor   for   sqlstr;"
                    + " end; return ResultCursor;";
            //DataTable tmptable = DBCommon.SqlGetTable(a);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            MessageBox.Show(CommonLib.ComMon.StringCommon.GetSpellsStr(textBox2.Text));
            MessageBox.Show(CommonLib.ComMon.StringCommon.GetSpellStr(textBox1.Text));
        }

        private void button6_Click(object sender, EventArgs e)
        {
            string[,] worktime = new string[2, 2] { { "8:30", "12:00" }, { "13:00", "17:00" } };
            TimeSpan ts = CommonLib.BLL.BaseCommonBll.WorkTimeDiff(DateTime.Parse("2010-09-02 07:52:30"), DateTime.Parse("2010-09-06 17:31:42"), worktime);

             DateTime rtnDate = CommonLib.BLL.BaseCommonBll.WorkTimeAdd(DateTime.Parse("2010-09-04 07:52:30"), ts, worktime);
        }

    }
}